// @ts-ignore
import axios, {AxiosRequestConfig} from 'axios'

// @ts-ignore
import { pathToBase64, base64ToPath } from 'image-tools'

class ImageUtils {
    async toBase64(path: string) {
        let base64Str: string = '';
        await pathToBase64(path)
            .then((base64: any) => {
                base64Str = base64;
                console.log(base64)
            })
            .catch((error: any) => {
                console.error(error)
                return Promise.reject(error)
            })

        return Promise.resolve(base64Str);
    }
}

export default new ImageUtils()